Code
# positioned in parent folder /Users/testuser/GH_test/
git clone https://github.com/Lulliter/nerd_help.git
cd nerd_helpWed, 13 of March, 2024
Wed, 13 of March, 2024
Web page construction in progress…
…
…
origin = origin stands for the remote repository. When we use git push -u origin local_branch_name, it tells the system that we want to push our local branch to the remote repository. Usually there is one default remote repository and origin represents this default repository.
git remote rename origin new_name
HEAD = the last commit of the active/current branch. Each repository only has one current branch, hence one HEAD as well. If you want to check where the HEAD of a repository is pointing to, run cat .git/HEAD
Detached HEAD happens when a checkout command is applied to a specific historical commit, tag or remote branch.
master master is a branch, the default branch, the main branch, and it’s always there.
branch branch is a like a fork in the history of a repository. One branch represents an independent line of development, like a fork teeth.
index index is the proposed next commit, also called staging area.
See Figure 1
git status = View the state of working directory and staging areagit add = Stage changes for next commitgit commit = Commit the staged snapshot to the local repositorygit push = Upload local repository content to a remote repository
git clone = Copies an entire remote repository down to your local machine, setting up a cloned version and checks out the default branch (generally master)
git fetch = Download content from remote repository, but doesn’t force the merge
git merge = Join two branches togethergit pull = Combo of git fetch and git mergeSource: cloudstudio.com.au
git fetch & git pull
git merge & git rebase
https://blog.git-init.com/differences-between-git-merge-and-rebase-and-why-you-should-care/
I create a test GH account lula-test (associated to l__a__a@icloud.com)
I clone in /Users/testuser/GH_test/nerd_help this repository “nerd-help” I own as Lulliter and (from there (I indicated that lula-test is a collaborator)
THE MASTER BRANCH SHOULD ALWAYS BE DEPLOYABLE
–> you create new branches for new features and merge them into Master when they’re completed.
–> It’s also important when collaborating that your team picks features that don’t have overlapping code.